package com.cqie.secondhandtransaction.DTO;

import com.baomidou.mybatisplus.annotation.*;
import com.cqie.secondhandtransaction.entity.AccessInfo;
import com.cqie.secondhandtransaction.utils.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class ProductInfoDTO {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("商品名称")
    private String productName;

    @ApiModelProperty("商品价格")
    private BigDecimal price;

    @ApiModelProperty("商品描述")
    private String description;

    @ApiModelProperty("图片url")
    private String picture;

    @ApiModelProperty("商品类别id")
    private Integer typeId;

    @ApiModelProperty("商品类别")
    private String typeName;

    @ApiModelProperty("库存,默认为1")
    private Integer count = 1;

    @ApiModelProperty("状态，S_PUB-发布，DRAFT-草稿,SOLD_OUT-售罄，WAIT_AUDIT-待审核")
    private String status;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = DateUtil.DATETIME_FORMAT)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = DateUtil.DATETIME_FORMAT)
    private Date updateTime;

    @ApiModelProperty("审核时间")
    private Date auditTime;

    @ApiModelProperty("商家")
    private Integer sallorBy;

    private String sallorName;

    @ApiModelProperty("收藏人数")
    private Integer collectionCount;

    @ApiModelProperty("是否收藏")
    private Boolean isCollected;

    @ApiModelProperty("浏览量")
    private Integer viewCount;

    @ApiModelProperty("成色")
    private String productLevel;

    @ApiModelProperty("品牌")
    private String brand;

    @ApiModelProperty("评论信息")
    private List<AccessInfo> accessInfoList;

    @ApiModelProperty("商家信息")
    private AccessUserDTO sallorInfo;

    @ApiModelProperty("是否评价过")
    private Boolean isAccessed = false;
}
